From: Takao Fujiwara Date: Wed, 27 Aug 2025 09:00:30 +0000 (+0900) Subject: ibusCandidatePopup: Fix scaling set-cursor-location-relative signal handling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~88^2~9^2^2~30 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dac373477b7384988079618c382819895bf8bdfa;p=gnome-shell.git ibusCandidatePopup: Fix scaling set-cursor-location-relative signal handling Need to convert the raw coordinates to the scaled ones in gnome-shell. IBus GtkIMModule can calculate the relative coordinates and gnome-shell needs to provide the actual scale. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8424 Part-of: (cherry picked from commit 2b2456e87d02b36fa85cdf434011f44143688215) --- diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js index 0bb4e47ee..6389f558e 100644 --- a/js/ui/ibusCandidatePopup.js +++ b/js/ui/ibusCandidatePopup.js @@ -222,11 +222,13 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer { let rect = new Mtk.Rectangle({x, y, width: w, height: h}); rect = focusWindow.protocol_to_stage_rect(rect); const windowActor = focusWindow.get_compositor_private(); + // IBus GtkIMModule cannot get the shell scale. + const scale = windowActor.get_resource_scale(); this._setDummyCursorGeometry( - windowActor.x + rect.x, - windowActor.y + rect.y, - rect.width, - rect.height); + windowActor.x + rect.x / scale, + windowActor.y + rect.y / scale, + rect.width / scale, + rect.height / scale); }); } catch { // Only recent IBus versions have support for this signal